package com.level2app.utils;

/**
 * Created by S
 * time 2024/8/20
 */
public class StrUtils {

    public static String escapeString(String txt) {
        if (txt.startsWith(".")) {
            return txt = "\\" + txt;
        } else if (txt.startsWith("$")) {
            return txt = "\\" + txt;
        } else if (txt.startsWith("|")) {
            return txt = "\\" + txt;
        } else if (txt.startsWith("(")) {
            return txt = "\\" + txt;
        } else if (txt.startsWith(")")) {
            return txt = "\\" + txt;
        } else if (txt.startsWith("{")) {
            return txt = "\\" + txt;
        } else if (txt.startsWith("^")) {
            return txt = "\\" + txt;
        } else if (txt.startsWith("^")) {
            return txt = "\\" + txt;
        } else if (txt.startsWith("?")) {
            return txt = "\\" + txt;
        } else if (txt.startsWith("*")) {
            return txt = "\\" + txt;
        } else if (txt.startsWith("+")) {
            return txt = "\\" + txt;
        } else if (txt.startsWith("\\")) {
            return txt = "\\" + txt;
        } else {
            return txt;
        }
    }
}
